<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!-- alan_18.2.7 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>">
<title>项目管理</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="${base}/css/bootstrap.css">
<script type="text/javascript" src="${base}/js/jquery-3.1.0.js"></script>
<script type="text/javascript" src="${base}/js/bootstrap.js"></script>
</head>

<body>
	<div class="container">
		<jsp:include page="${path}/menu.jsp"></jsp:include>
		<div style="margin-left: 20px;margin-bottom: 10px; color: grey">当前位置：项目管理 > 已归档项目</div>
		
		<div class="container-fluid">
			<div class="row-fluid">
				
				<a href="${base}/project/findUnFinishProjects?userId=${user.id}"><button type="button" class="btn btn-primary" style="width: 80px;background-color: gray;">进行中</button></a>
				<a href="${base}/project/findFinishProjects?userId=${user.id}"><button type="button" class="btn btn-primary" style="width: 80px">已归档</button></a>
				<a href="${base}/project/projectList?userId=${user.id}"><button type="button" class="btn btn-primary" style="width: 80px;background-color: gray;">全部</button></a>
				<div class="span12">
				<!-- alan_18.2.7_start_update_style -->
					<table class="table table-striped table-bordered table-hover dataTables-example">
						<thead>
							<tr bgcolor="#87CEEB">
								<th>项目名(点击查看项目信息)</th>
								<th>项目经理</th>
								<th>项目人数</th>
								<th>项目描述</th>
								<th>创建时间</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${projects}" var="project">

								<tr class="gradeX">
									<td><a
										href="${base}/project/projectInfo?projectId=${project.id}">${project.projectName}</a></td>
									<td>${project.managerName}</td>
									<td>
										${project.memberNum}
									</td>
									<td>${project.projectDesc }
										<%-- <button type="button" class="btn btn-danger btn-sm delete"
												onclick="deleteProject(${project.id})">delete</button> --%>
									</td>
									<td>
										<fmt:formatDate type="both" dateStyle="short" timeStyle="short" value="${project.createDate}" />
									</td>
								</tr>
									
									<!-- alan_18.2.7_end_update_style -->
							</c:forEach>
						</tbody>
					</table>
					<a href="${base}/project/create"><button type="button"
							class="btn btn-primary">新建项目</button> </a>
					<!-- <button class="btn btn-primary  dim btn-large-dim" type="button"><i class="fa fa-dollar"></i>6</button> -->
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">

	function deleteProject(obj) {
	    
	    var param = "projectId=" + obj;
	    if (confirm("确认删除"+param+"吗？")){
			$.ajax({
				url: "${base}/project/delete",
				data: {projectId:obj},
				dataType: "json",
				type: "POST",
				success: function (data) {
					
					 location.reload(); 
				},
				async: true,
				cache: false
				});
	    }
	}
	
	
	$(".tr").bind("mouseover", function() {
		$(this).css("background-color", "#eeeeee");
	})
	$(".tr").bind("mouseout", function() {
		$(this).css("background-color", "#ffffff");
	})
</script>
</html>


